<?php

namespace App\Models\Customer;

use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model;

/**
 * Class WaxSkinSuggest
 * @package App\Models\Customer
 * @mixin Builder
 *
 * @method static self filterLanguageId($language_id)
 */

class WaxSkinSuggest extends Model
{
    protected $table = 'wax_skin_suggests';
    protected $guarded = [];

    /**
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
     */
    public function customerRelateWaxSkin()
    {
        return $this->belongsTo(CustomerRelateWaxSkin::class, 'customer_relate_wax_skin_id', 'id');
    }

    /**
     * @uses filterLanguageId()
     *
     * @param Builder $query
     * @param $language_id
     * @return Builder
     */
    public function scopeFilterLanguageId(Builder $query, $language_id)
    {
        if (! $language_id) { return $query;}

        return $query->where('language_id', $language_id);
    }
}
